{% extends "registration/base.html" %}

{% load i18n %}
{% load qatrack_tags %}

{% block head_title %}{% trans "Password Reset" %}{% endblock %}

{% block reset_active %} class="active"{% endblock %}

{% block account_box %}

<div class="box">

  <div class="box-header">
    <h3 class="box-title">
      <span class="fa fa-stack fa-fw" aria-hidden="true">
        <i class="fa fa-lock fa-stack-custom-main"></i>
        <i class="fa fa-undo fa-stack-custom-sub primary"></i>
      </span>
      {% trans "Password Reset" %}
    </h3>
    <p>{% trans "Forgotten your password? Enter your email address below, and we'll send you an email allowing you to reset it." %}</p>
  </div>

  <div class="box-body">
    {% if user.is_authenticated %}
      <div class="alert alert-info">
        <strong>{% trans "Note" %}</strong>:
        {% blocktrans %}you are already logged in as {{ user }}.{% endblocktrans %}
      </div>
    {% endif %}

    <form method="POST" action="">
      {% csrf_token %}

      {% if form.non_field_errors %}
        <div class="alert alert-error">
          {% if form_error_title %}
            <strong>{{ form_error_title }}</strong>
          {% endif %}
          {% for error in form.non_field_errors %}
            {{ error }}<br />
          {% endfor %}
        </div>
      {% endif %}

      {% for field in form %}
        {% if field.is_hidden %}
          {{ field }}
        {% else %}
          <div class="form-group {% if field.errors %}has-error{% endif %}">
            {{ field|addcss_addplaceholder:"form-control" }}
            {% for error in field.errors %}
              <span class="help-block">{{ error }}</span>
            {% endfor %}
            {% if field.help_text %}
              <p class="help-block">{{ field.help_text|safe }}</p>
            {% endif %}
          </div>
        {% endif %}
      {% endfor %}

      <div class="form-actions">
        <button type="submit" class="btn btn-primary btn-flat">{% trans "Reset my password" %}</button>
      </div>

    </form>

  </div>
</div>
{% endblock account_box %}

